from pylab import *
from scipy.interpolate import interp1d

lsst_deep = loadtxt('SN_density_lsst_deep_raw.txt')

density = interp1d(lsst_deep[:,0],lsst_deep[:,1],kind='cubic')

z = linspace(lsst_deep[:,0].min(), lsst_deep[:,0].max(), 100)
n = zeros(z.shape)

for i in range(len(n)):
    n[i] = density(z[i])

savetxt('SN_density_lsst_deep.txt', hstack((z.reshape(len(z),1),n.reshape(len(n),1))), fmt='%7.4f', delimiter=' ')


